package com.quickcancellation.crm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.quickcancellation.crm.pojo.dto.PageParamsDto;
import com.quickcancellation.crm.pojo.entity.Dictionary;
import com.quickcancellation.crm.pojo.vo.DicKeyValVo;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author baomidou
 * @since 2023-02-18
 */
public interface IDictionaryService extends IService<Dictionary> {
    /**
     * 查询字典列表
     * @param params
     * @return
     */
    public IPage<Dictionary> selectByDicList(PageParamsDto<Dictionary> params);

    /**
     * 获取新的字典key
     * @return
     */
    String getNewDicKey();

    /**
     * 字典值是否已经存在
     * @param dicVal
     * @return
     */
    boolean existsDictionary(Long id,String dicVal);

    /**
     * 根据字典类型获取字典键值
     * @param model
     * @return
     */
    List<DicKeyValVo> getDicKeyAndValByModel(String model);
}
